<?php
/**
 * Name: 管理员控制器
 * User: 董坤鸿
 * Date: 2017/9/13
 * Time: 下午8:24
 */

namespace app\admin\controller;


use app\model\Admins;

class Admin extends Common
{

    /**
     * 修改密码
     *
     * @return \think\response\View
     */
    public function password()
    {
        if (request()->isPost()) {
            $res = (new Admins())->password(input('post.'));
            if ($res['valid']) {
                //清楚session中的登录信息
                session(null);
                //执行成功
                $this->success($res['msg'], 'admin/index/index');
                exit;
            } else {
                $this->error($res['msg']);
                exit;
            }
        }
        return view();
    }

}